home *** CD-ROM | disk | FTP | other *** search
- .xlist ; hide from .LST file
- .xcref ; hide symbols from .LST & .REF files
- ; this file contains macros that function like
- ; some of the 186 (286) instructions
- .xcref enter
- ; the level function not fully tested yet
- enter macro locals,level
- push bp
- if level
- .xcref ._level_
- ._level_ = level - 1
- if ._level_
- mov ax,sp
- .xcref ._levelc_
- ._levelc_ = 1
- rept _level
- push [bp-2*._levelc_]
- ._levelc_ = ._levelc_+1
- endm
- push ax
- mov bp,ax
- else
- mov bp,sp
- push bp
- endif
- else
- mov bp,sp
- endif
- if locals
- sub sp,locals
- endif
- endm
- .xcref leave
- leave macro
- mov sp,bp
- pop bp
- endm
- .xcref pusha
- pusha macro
- push ax
- push cx
- push dx
- push bx
- xchg bx,bp ;; make effort to push sp
- mov bp,sp
- lea bp,[bp+8] ;; point to before ax
- push bp
- mov bp,[bp-8]
- xchg bx,bp ;; all done show no sign
- push bp
- push si
- push di
- endm
- .xcref popa
- popa macro
- pop di
- pop si
- pop bp
- pop bx ;; ignore pop sp
- pop bx
- pop dx
- pop cx
- pop ax
- endm
- .xcref bound
- bound macro reg,range
- local bound_int,bound_cont
- pushf
- cmp reg,word ptr range
- jl bound_int
- cmp reg,word ptr range+2
- jle bound_cont
- bound_int:
- int 5
- bound_cont:
- popf
- endm
- .cref
- .list
-